<?php 
$folder = $path = Yii::app()->getBaseUrl(true).'/protected/medias/product/images';

if($model->filename) 
	$path = $folder . '/' . $model->filename;
	else
	$path = $folder.'/no-pic.jpg';

echo CHtml::image($path,
		$model->title,
		array(
			'title' => $model->title,
			'style' => 'margin: 10px;',
			'width' => isset($thumb) && $thumb
			? Image::$imageWidthThumb 
			: Image::$imageWidth)
		); ?>
<?php 

if(Yii::app()->getController()->id != 'treeBuild') 
	echo CHtml::link('Delete Image',
			array('delete', 'id' => $model->id)); ?>
